/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Scanner;

/**
 * <p>Project: javase2203 - Ex2
 * <p>Powered by webrx On 2022-07-19 11:22:08
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex2 {
    public static void main(String[] args) {
        //方法二Scanner
        Scanner sc = new Scanner(System.in);
        Ex2 e = new Ex2();
        System.out.println(e.sum(sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt(),sc.nextInt()));



        //方法一
        if (args.length > 0) {
            int sum = 0;
            for (String s : args) {
                sum += Integer.parseInt(s);
            }
            System.out.printf("%s 总结是：%d。", Arrays.toString(args), sum);
        }
    }

    public int sum(int... n) {
        int s = 0;
        for (int i : n) {
            s += i;
        }
        return s;
    }
}
